<table class="table table-hover">
  <thead>
    <tr>
      <th>
        订单号
      </th>
      <th>
        客户id
      </th>
      <th>
        订单状态
      </th>
      <th>
        货物件数
      </th>
      <th>
        订单总额
      </th>
      <th>
        订单备注
      </th>
      <th>
        操作
      </th>
    </tr>
  </thead>
  <tbody>
  <% for (var i=0; i<data.length; i++) {%>
    <tr>
      <th>
        <%= data[i].id %>
      </th>
      <td><%= data[i].customer_openId %></td>
      <td><%= data[i].status %></td>
      <td><%= data[i].total_quantity %></td>
      <td><%= data[i].total_amount %></td>
      <td><%= data[i].remark %></td>
      <td>
        <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#detail-<%= data[i].id %>">详情</button>
        <a class="btn btn-info" href="/admin/order/split/<%= data[i].id %>">拆分</a>
      </td>
    </tr>
    <div class="modal fade" id="detail-<%= data[i].id %>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="myModalLabel">订单详情</h4>
          </div>
          <div class="modal-body">
            <h4>联系人信息</h4>
            <p>姓名: <%= contact[0][i].name %></p>
            <p>电话: <%= contact[0][i].phone %></p>
            <p>地址: <%= contact[0][i].country+' '+contact[0][i].province+'省'+contact[0][i].city+'市'%></p>
            <h4>商品信息</h4>
            <p>ak-47*10</p>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
          </div>
        </div>
      </div>
    </div>
  <% }%>
  </tbody>
</table>
